# 
# itertool - a polynormial and type-safe iterator framework in C++.
# 
# Copyright (c) 2021-2025 Feng Cong
# 
# Distributed under the MIT Software License
# See accompanying file LICENSE.txt or copy at
# https://opensource.org/licenses/MIT

project(itertool_test)

set(ITERTOOL_TEST_EXE_NAME test_itertool)

set(ITERTOOL_TEST_SOURCE
    natural_number.cpp
    fibonacci_number.cpp
    iterator_iterable.cpp
    repeat.cpp
    enumerate.cpp
    empty.cpp
    filter.cpp
    chain.cpp
    map.cpp
    zip.cpp
    adapter.cpp
    seq.cpp
    itertool.cpp
    cycle.cpp
    main.cpp
)

add_executable(
    ${ITERTOOL_TEST_EXE_NAME}
    ${ITERTOOL_TEST_SOURCE}
)

target_compile_features(${ITERTOOL_TEST_EXE_NAME} PRIVATE cxx_std_17)

target_link_libraries(${ITERTOOL_TEST_EXE_NAME}
    PRIVATE doctest::doctest
    PRIVATE itertool::itertool
)

# 这是 doctest 2.4.6 引入的bug，参考：
# https://github.com/onqtam/doctest/pull/464
doctest_discover_tests(${ITERTOOL_TEST_EXE_NAME})
